package triannon.client;

import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import org.pushingpixels.substance.api.skin.SubstanceRavenLookAndFeel;

import triannon.client.components.TFrame;
import triannon.client.sprites.SpriteInfoMap;
import triannon.client.util.DebuggerFrame;
import triannon.client.util.ResourceLocator;
import triannon.client.util.timer.TTimer;

public class TriannonClient {
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {

			@Override
			public void run() {
				try {
					JDialog.setDefaultLookAndFeelDecorated(true);
					UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());
				} catch (UnsupportedLookAndFeelException e) {
					e.printStackTrace();
				}

				ResourceLocator.addResourceDir("triannon/client/resource/sprites/");
				ResourceLocator.addResourceDir("triannon/client/resource/");

				SpriteInfoMap.getInstance();

				TFrame tFrame = new TFrame();
				tFrame.setVisible(true);
				DebuggerFrame debuggerFrame = new DebuggerFrame();
				debuggerFrame.setVisible(true);
				debuggerFrame.setLocation(tFrame.getLocation());

				TTimer.getInstance().startTimer(30);
			}
		});

	}
}
